{{define "title"}}Auth Service - Changes{{end}}

{{define "content"}}

<script type="text/javascript" src="/ui/static/js/change_log.js"></script>

<template id="change-log-row-template">
  <tr>
    <td class="change-log-rev">
      <a href="#"></a>
    </td>
    <td class="change-log-type">
      <span class="view-change" style="cursor: pointer;">
      </span>
    </td>
    <td class="change-log-when"></td>
    <td class="change-log-who"></td>
    <td class="change-log-target">
      <a href="#"></a>
    </td>
  </tr>
</template>

<template id="change-log-header-template">
  <h3 class="text-center mb-4">
    <a href="#"></a>
    <small class="text-muted"></small>
  </h3>
</template>

<div class="container px-0">
  <div id="loading-box-placeholder"></div>

  <div id="change-log-content" style="display: none;">
    <div id="change-log-header">
      <!-- Load change-log-header-template -->
    </div>

    <!-- Alert to show if there are no change logs. -->
    <div id="change-log-empty-alert" style="display: none;" class="alert alert-primary mt-4 mb-0" role="alert">
      <i class="bi bi-info-circle-fill me-1"></i>
      No change logs found.
    </div>

    <table id="change-log-table" class="table table-hover my-0">
      <thead class="border-top">
        <tr>
          <th scope="col" style="width: 80px">Rev</th>
          <th scope="col" style="width: 250px">Change</th>
          <th scope="col" style="width: 200px">When</th>
          <th scope="col" style="width: 280px">Who</th>
          <th>What</th>
        </tr>
      </thead>
      <tbody id="change-log-body">
        <!-- Load change-log-row-template -->
      </tbody>
      <tfoot>
        <tr>
          <td colspan="5" class="border-bottom-0 pt-4 pb-0">
            <nav id="change-log-pager">
              <ul class="pagination justify-content-between my-0">
                <li id="prev" class="page-item">
                  <a class="page-link" href="#"><span aria-hidden="true">&laquo;</span> Newer</a>
                </li>
                <li id="next" class="page-item">
                  <a class="page-link" href="#">Older <span aria-hidden="true">&raquo;</span></a>
                </li>
              </ul>
            </nav>
          </td>
        </tr>
      </tfoot>
    </table>
  </div>

  <!-- Placeholder for change log listing error. -->
  <div id="api-error-placeholder"></div>

</div>

<div class="modal fade" id="change-log-modal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">Change Details</h4>
      </div>
      <div class="modal-body">
        <pre id="details-text"></pre>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
          Close
        </button>
      </div>
    </div>
  </div>
</div>

{{end}}